﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.MenuCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.MenuHandler
{
    public class MenuShowCommandHandler:IRequestHandler<MenuShowCommand, FenYeDTO<MenuDTO>>
    {
        /// <summary>
        /// 菜单服务层接口
        /// </summary>
        IMenuService mSer;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="urSer"></param>
        public MenuShowCommandHandler(IMenuService mSer)
        {
            this.mSer = mSer;
        }

        public async Task<FenYeDTO<MenuDTO>> Handle(MenuShowCommand request, CancellationToken cancellationToken)
        {
            return await mSer.GetAllMenuList(request.poageiden, request.pageSzen, request.Name);
        }
    }
}
